/**
 * Created by Administrator on 2016/2/24.
 */
var otherService = angular.module('OtherService');
otherService.factory("api_other", function($http,api_path){

    var base_addr = api_path.base_addr;
    var api_addr = api_path.api_addr;
    return {
        //登录
        userLogin:function(obj){
            var obj = JSON.stringify(obj);
            var the_api = base_addr + api_addr.user_login;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/json;charset=UTF-8'}});
            //var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            //var promise = $http.get(the_api,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //初始列表
        initList:function(){
            var the_api = base_addr + api_addr.init_list;
            var promise = $http.post(the_api,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //考试列表(初始进入)
        testList:function(obj){
            var params = {parent_id:obj};
            var the_api = base_addr + api_addr.test_list;
            var promise = $http.post(the_api,params,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //考试内容
        testContent:function(obj){
            var params = {catId:obj.catId,page:obj.page};
            var the_api = base_addr + api_addr.test_content;
            var promise = $http.post(the_api,params,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //错题提交
        wrongSubmit:function(obj){
            var the_api = base_addr + api_addr.wrong_submit;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //收藏题目
        collectTimu:function(obj){
            var the_api = base_addr + api_addr.collect_timu;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //笔记保存
        bijiSave:function(obj){
            var the_api = base_addr + api_addr.biji_save;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //笔记列表
        bijiList:function(obj){
            var the_api = base_addr + api_addr.biji_list;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //错题
        wrongList:function(obj){
            var the_api = base_addr + api_addr.wrong_list;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //指南列表
        zhinanList:function(obj){
            var the_api = base_addr + api_addr.zhinan_list;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //指南详情
        zhinanDetail:function(obj){
            var the_api = base_addr + api_addr.zhinan_detail;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //点题列表
        diantiList:function(obj){
            var the_api = base_addr + api_addr.dianti_list;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //收藏练习
        shoucangList:function(obj){
            var the_api = base_addr + api_addr.shoucang_list;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //用户信息
        selfInfo:function(obj){
            var the_api = base_addr + api_addr.selfInfo;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //用户信息编辑
        selfEdit:function(obj){
            var the_api = base_addr + api_addr.selfEdit;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //订单列表
        dingdanList:function(obj){
            var the_api = base_addr + api_addr.dingdan_list;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //资料文库
        ziliao:function(obj){
            var the_api = base_addr + api_addr.ziliao;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },//资料标签
        ziliaobiaoqian:function(obj){
            var the_api = base_addr + api_addr.ziliaobiaoqian;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },//首页banner
        getBanner:function(obj){
            var the_api = base_addr + api_addr.banner;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //设置考试时间
        setTime:function(obj){
            var the_api = base_addr + api_addr.setTime;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //get考试时间
        getTime:function(obj){
            var the_api = base_addr + api_addr.getTime;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //通关书籍列表
        bookList:function(obj){
            var the_api = base_addr + api_addr.bookList;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //通关书籍详情
        bookDetail:function(obj){
            var the_api = base_addr + api_addr.bookDetail;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        },
        //通关书籍订单
        bookDingDan:function(obj){
            var the_api = base_addr + api_addr.bookDianDan;
            var promise = $http.post(the_api,obj,{headers:{'Content-Type':'application/x-www-form-urlencoded'}});
            return promise;
        }
    };
});